home *** CD-ROM | disk | FTP | other *** search
/ Micromanía: 150 Juegos 2010 / 150Juegos_16.iso / Shareware / Shape Smash / shape-smash.swf / scripts / Box2D / Dynamics / _fp437.as < prev    next >
Encoding:
Text File  |  2010-05-14  |  36.4 KB  |  1,045 lines

  1. package Box2D.Dynamics
  2. {
  3.    import Box2D.Collision.*;
  4.    import Box2D.Collision.Shapes.*;
  5.    import Box2D.Common.*;
  6.    import Box2D.Common.Math.*;
  7.    import Box2D.Dynamics.Contacts.*;
  8.    import Box2D.Dynamics.Joints.*;
  9.    
  10.    public class _fp437
  11.    {
  12.       public static var m_continuousPhysics:Boolean;
  13.       
  14.       public static var m_warmStarting:Boolean;
  15.       
  16.       public static var m_positionCorrection:Boolean;
  17.       
  18.       private static var s_jointColor:_ny735 = new _ny735(0.5,0.8,0.8);
  19.       
  20.       private static var s_coreColor:_ny735 = new _ny735(0.9,0.6,0.6);
  21.       
  22.       private static var s_xf:_ni781 = new _ni781();
  23.       
  24.       public var m_blockAllocator:*;
  25.       
  26.       public var m_boundaryListener:_wy488;
  27.       
  28.       public var m_contactList:_nb823;
  29.       
  30.       public var m_contactListener:_nu737;
  31.       
  32.       public var m_broadPhase:_lx230;
  33.       
  34.       public var m_inv_dt0:Number;
  35.       
  36.       public var m_jointCount:int;
  37.       
  38.       public var m_bodyCount:int;
  39.       
  40.       public var m_lock:Boolean;
  41.       
  42.       public var m_destructionListener:_sk806;
  43.       
  44.       public var m_allowSleep:Boolean;
  45.       
  46.       public var m_positionIterationCount:int;
  47.       
  48.       public var m_groundBody:_th791;
  49.       
  50.       public var m_contactCount:int;
  51.       
  52.       public var m_contactFilter:_fm757;
  53.       
  54.       public var m_bodyList:_th791;
  55.       
  56.       public var m_debugDraw:_ee618;
  57.       
  58.       public var m_stackAllocator:*;
  59.       
  60.       public var m_jointList:_yw701;
  61.       
  62.       public var m_gravity:b2Vec2;
  63.       
  64.       public var m_contactManager:_gj519;
  65.       
  66.       public function _fp437(param1:_pv475, param2:b2Vec2, param3:Boolean)
  67.       {
  68.          var _loc4_:_qh446 = null;
  69.          m_contactManager = new _gj519();
  70.          super();
  71.          m_destructionListener = null;
  72.          m_boundaryListener = null;
  73.          m_contactFilter = _fm757.b2_defaultFilter;
  74.          m_contactListener = null;
  75.          m_debugDraw = null;
  76.          m_bodyList = null;
  77.          m_contactList = null;
  78.          m_jointList = null;
  79.          m_bodyCount = 0;
  80.          m_contactCount = 0;
  81.          m_jointCount = 0;
  82.          m_positionCorrection = true;
  83.          m_warmStarting = true;
  84.          m_continuousPhysics = true;
  85.          m_allowSleep = param3;
  86.          m_gravity = param2;
  87.          m_lock = false;
  88.          m_inv_dt0 = 0;
  89.          m_contactManager.m_world = this;
  90.          m_broadPhase = new _lx230(param1,m_contactManager);
  91.          _loc4_ = new _qh446();
  92.          m_groundBody = _ea632(_loc4_);
  93.       }
  94.       
  95.       public function _ap354(param1:_yw701) : void
  96.       {
  97.          var _loc2_:Boolean = false;
  98.          var _loc3_:_th791 = null;
  99.          var _loc4_:_th791 = null;
  100.          var _loc5_:_th791 = null;
  101.          var _loc6_:_hx306 = null;
  102.          _loc2_ = param1.m_collideConnected;
  103.          if(param1.m_prev)
  104.          {
  105.             param1.m_prev.m_next = param1.m_next;
  106.          }
  107.          if(param1.m_next)
  108.          {
  109.             param1.m_next.m_prev = param1.m_prev;
  110.          }
  111.          if(param1 == m_jointList)
  112.          {
  113.             m_jointList = param1.m_next;
  114.          }
  115.          _loc3_ = param1.m_body1;
  116.          _loc4_ = param1.m_body2;
  117.          _loc3_._uo631();
  118.          _loc4_._uo631();
  119.          if(param1.m_node1.prev)
  120.          {
  121.             param1.m_node1.prev.next = param1.m_node1.next;
  122.          }
  123.          if(param1.m_node1.next)
  124.          {
  125.             param1.m_node1.next.prev = param1.m_node1.prev;
  126.          }
  127.          if(param1.m_node1 == _loc3_.m_jointList)
  128.          {
  129.             _loc3_.m_jointList = param1.m_node1.next;
  130.          }
  131.          param1.m_node1.prev = null;
  132.          param1.m_node1.next = null;
  133.          if(param1.m_node2.prev)
  134.          {
  135.             param1.m_node2.prev.next = param1.m_node2.next;
  136.          }
  137.          if(param1.m_node2.next)
  138.          {
  139.             param1.m_node2.next.prev = param1.m_node2.prev;
  140.          }
  141.          if(param1.m_node2 == _loc4_.m_jointList)
  142.          {
  143.             _loc4_.m_jointList = param1.m_node2.next;
  144.          }
  145.          param1.m_node2.prev = null;
  146.          param1.m_node2.next = null;
  147.          _yw701._ai321(param1,m_blockAllocator);
  148.          --m_jointCount;
  149.          if(_loc2_ == false)
  150.          {
  151.             _loc5_ = _loc3_.m_shapeCount < _loc4_.m_shapeCount ? _loc3_ : _loc4_;
  152.             _loc6_ = _loc5_.m_shapeList;
  153.             while(_loc6_)
  154.             {
  155.                _loc6_._jt704(m_broadPhase,_loc5_.m_xf);
  156.                _loc6_ = _loc6_.m_next;
  157.             }
  158.          }
  159.       }
  160.       
  161.       public function _og618(param1:_ee618) : void
  162.       {
  163.          m_debugDraw = param1;
  164.       }
  165.       
  166.       public function _yd266(param1:b2Vec2) : void
  167.       {
  168.          m_gravity = param1;
  169.       }
  170.       
  171.       public function _ea632(param1:_qh446) : _th791
  172.       {
  173.          var _loc2_:_th791 = null;
  174.          if(m_lock == true)
  175.          {
  176.             return null;
  177.          }
  178.          _loc2_ = new _th791(param1,this);
  179.          _loc2_.m_prev = null;
  180.          _loc2_.m_next = m_bodyList;
  181.          if(m_bodyList)
  182.          {
  183.             m_bodyList.m_prev = _loc2_;
  184.          }
  185.          m_bodyList = _loc2_;
  186.          ++m_bodyCount;
  187.          return _loc2_;
  188.       }
  189.       
  190.       public function _nl191(param1:Boolean) : void
  191.       {
  192.          m_warmStarting = param1;
  193.       }
  194.       
  195.       public function _qr65(param1:_pv475, param2:Array, param3:int) : int
  196.       {
  197.          var _loc4_:Array = null;
  198.          var _loc5_:int = 0;
  199.          var _loc6_:int = 0;
  200.          _loc4_ = new Array(param3);
  201.          _loc5_ = m_broadPhase._yg769(param1,_loc4_,param3);
  202.          _loc6_ = 0;
  203.          while(_loc6_ < _loc5_)
  204.          {
  205.             param2[_loc6_] = _loc4_[_loc6_];
  206.             _loc6_++;
  207.          }
  208.          return _loc5_;
  209.       }
  210.       
  211.       public function _ej487() : void
  212.       {
  213.          m_broadPhase._ej487();
  214.       }
  215.       
  216.       public function _mm442(param1:_hx306) : void
  217.       {
  218.          param1._jt704(m_broadPhase,param1.m_body.m_xf);
  219.       }
  220.       
  221.       public function _qk184(param1:_es399) : _yw701
  222.       {
  223.          var _loc2_:_yw701 = null;
  224.          var _loc3_:_th791 = null;
  225.          var _loc4_:_hx306 = null;
  226.          _loc2_ = _yw701._em71(param1,m_blockAllocator);
  227.          _loc2_.m_prev = null;
  228.          _loc2_.m_next = m_jointList;
  229.          if(m_jointList)
  230.          {
  231.             m_jointList.m_prev = _loc2_;
  232.          }
  233.          m_jointList = _loc2_;
  234.          ++m_jointCount;
  235.          _loc2_.m_node1.joint = _loc2_;
  236.          _loc2_.m_node1.other = _loc2_.m_body2;
  237.          _loc2_.m_node1.prev = null;
  238.          _loc2_.m_node1.next = _loc2_.m_body1.m_jointList;
  239.          if(_loc2_.m_body1.m_jointList)
  240.          {
  241.             _loc2_.m_body1.m_jointList.prev = _loc2_.m_node1;
  242.          }
  243.          _loc2_.m_body1.m_jointList = _loc2_.m_node1;
  244.          _loc2_.m_node2.joint = _loc2_;
  245.          _loc2_.m_node2.other = _loc2_.m_body1;
  246.          _loc2_.m_node2.prev = null;
  247.          _loc2_.m_node2.next = _loc2_.m_body2.m_jointList;
  248.          if(_loc2_.m_body2.m_jointList)
  249.          {
  250.             _loc2_.m_body2.m_jointList.prev = _loc2_.m_node2;
  251.          }
  252.          _loc2_.m_body2.m_jointList = _loc2_.m_node2;
  253.          if(param1.collideConnected == false)
  254.          {
  255.             _loc3_ = param1.body1.m_shapeCount < param1.body2.m_shapeCount ? param1.body1 : param1.body2;
  256.             _loc4_ = _loc3_.m_shapeList;
  257.             while(_loc4_)
  258.             {
  259.                _loc4_._jt704(m_broadPhase,_loc3_.m_xf);
  260.                _loc4_ = _loc4_.m_next;
  261.             }
  262.          }
  263.          return _loc2_;
  264.       }
  265.       
  266.       public function _gu529(param1:Number, param2:int) : void
  267.       {
  268.          var _loc3_:_ut97 = null;
  269.          m_lock = true;
  270.          _loc3_ = new _ut97();
  271.          _loc3_.dt = param1;
  272.          _loc3_.maxIterations = param2;
  273.          if(param1 > 0)
  274.          {
  275.             _loc3_.inv_dt = 1 / param1;
  276.          }
  277.          else
  278.          {
  279.             _loc3_.inv_dt = 0;
  280.          }
  281.          _loc3_.dtRatio = m_inv_dt0 * param1;
  282.          _loc3_.positionCorrection = m_positionCorrection;
  283.          _loc3_.warmStarting = m_warmStarting;
  284.          m_contactManager._yo98();
  285.          if(_loc3_.dt > 0)
  286.          {
  287.             _eq278(_loc3_);
  288.          }
  289.          if(m_continuousPhysics && _loc3_.dt > 0)
  290.          {
  291.             _ss251(_loc3_);
  292.          }
  293.          _yi655();
  294.          m_inv_dt0 = _loc3_.inv_dt;
  295.          m_lock = false;
  296.       }
  297.       
  298.       public function _md511(param1:_th791) : void
  299.       {
  300.          var _loc2_:_gs664 = null;
  301.          var _loc3_:_hx306 = null;
  302.          var _loc4_:_gs664 = null;
  303.          var _loc5_:_hx306 = null;
  304.          if(m_lock == true)
  305.          {
  306.             return;
  307.          }
  308.          _loc2_ = param1.m_jointList;
  309.          while(_loc2_)
  310.          {
  311.             _loc4_ = _loc2_;
  312.             _loc2_ = _loc2_.next;
  313.             if(m_destructionListener)
  314.             {
  315.                m_destructionListener._qk634(_loc4_.joint);
  316.             }
  317.             _ap354(_loc4_.joint);
  318.          }
  319.          _loc3_ = param1.m_shapeList;
  320.          while(_loc3_)
  321.          {
  322.             _loc5_ = _loc3_;
  323.             _loc3_ = _loc3_.m_next;
  324.             if(m_destructionListener)
  325.             {
  326.                m_destructionListener._ia490(_loc5_);
  327.             }
  328.             _loc5_._wp50(m_broadPhase);
  329.             _hx306._ai321(_loc5_,m_blockAllocator);
  330.          }
  331.          if(param1.m_prev)
  332.          {
  333.             param1.m_prev.m_next = param1.m_next;
  334.          }
  335.          if(param1.m_next)
  336.          {
  337.             param1.m_next.m_prev = param1.m_prev;
  338.          }
  339.          if(param1 == m_bodyList)
  340.          {
  341.             m_bodyList = param1.m_next;
  342.          }
  343.          --m_bodyCount;
  344.       }
  345.       
  346.       public function _il32(param1:_sk806) : void
  347.       {
  348.          m_destructionListener = param1;
  349.       }
  350.       
  351.       public function _bk63() : int
  352.       {
  353.          return m_broadPhase.m_pairManager.m_pairCount;
  354.       }
  355.       
  356.       public function _cx763(param1:_fm757) : void
  357.       {
  358.          m_contactFilter = param1;
  359.       }
  360.       
  361.       public function _fy651(param1:Boolean) : void
  362.       {
  363.          m_continuousPhysics = param1;
  364.       }
  365.       
  366.       public function _rv304() : _th791
  367.       {
  368.          return m_bodyList;
  369.       }
  370.       
  371.       public function _gg115(param1:_nu737) : void
  372.       {
  373.          m_contactListener = param1;
  374.       }
  375.       
  376.       public function _ss678() : _yw701
  377.       {
  378.          return m_jointList;
  379.       }
  380.       
  381.       public function _sf664() : int
  382.       {
  383.          return m_broadPhase.m_proxyCount;
  384.       }
  385.       
  386.       public function _ci380() : int
  387.       {
  388.          return m_bodyCount;
  389.       }
  390.       
  391.       public function _yi655() : void
  392.       {
  393.          var _loc1_:uint = 0;
  394.          var _loc2_:int = 0;
  395.          var _loc3_:_th791 = null;
  396.          var _loc4_:_hx306 = null;
  397.          var _loc5_:_yw701 = null;
  398.          var _loc6_:_lx230 = null;
  399.          var _loc7_:b2Vec2 = null;
  400.          var _loc8_:b2Vec2 = null;
  401.          var _loc9_:b2Vec2 = null;
  402.          var _loc10_:_ny735 = null;
  403.          var _loc11_:_ni781 = null;
  404.          var _loc12_:_pv475 = null;
  405.          var _loc13_:_pv475 = null;
  406.          var _loc14_:Array = null;
  407.          var _loc15_:* = false;
  408.          var _loc16_:uint = 0;
  409.          var _loc17_:_yl661 = null;
  410.          var _loc18_:_cm170 = null;
  411.          var _loc19_:_cm170 = null;
  412.          var _loc20_:b2Vec2 = null;
  413.          var _loc21_:b2Vec2 = null;
  414.          var _loc22_:_cm170 = null;
  415.          var _loc23_:_bs125 = null;
  416.          var _loc24_:_ik102 = null;
  417.          var _loc25_:b2Vec2 = null;
  418.          var _loc26_:_oh327 = null;
  419.          var _loc27_:b2Vec2 = null;
  420.          var _loc28_:Number = NaN;
  421.          if(m_debugDraw == null)
  422.          {
  423.             return;
  424.          }
  425.          m_debugDraw.m_sprite.graphics.clear();
  426.          _loc1_ = m_debugDraw._aq226();
  427.          _loc7_ = new b2Vec2();
  428.          _loc8_ = new b2Vec2();
  429.          _loc9_ = new b2Vec2();
  430.          _loc10_ = new _ny735(0,0,0);
  431.          _loc12_ = new _pv475();
  432.          _loc13_ = new _pv475();
  433.          _loc14_ = [new b2Vec2(),new b2Vec2(),new b2Vec2(),new b2Vec2()];
  434.          if(_loc1_ & _ee618.e_shapeBit)
  435.          {
  436.             _loc15_ = (_loc1_ & _ee618.e_coreShapeBit) == _ee618.e_coreShapeBit;
  437.             _loc3_ = m_bodyList;
  438.             while(_loc3_)
  439.             {
  440.                _loc11_ = _loc3_.m_xf;
  441.                _loc4_ = _loc3_._tq424();
  442.                while(_loc4_)
  443.                {
  444.                   if(_loc3_._ur192())
  445.                   {
  446.                      _sa385(_loc4_,_loc11_,new _ny735(0.5,0.9,0.5),_loc15_);
  447.                   }
  448.                   else if(_loc3_._bk718())
  449.                   {
  450.                      _sa385(_loc4_,_loc11_,new _ny735(0.5,0.5,0.9),_loc15_);
  451.                   }
  452.                   else
  453.                   {
  454.                      _sa385(_loc4_,_loc11_,new _ny735(0.9,0.9,0.9),_loc15_);
  455.                   }
  456.                   _loc4_ = _loc4_.m_next;
  457.                }
  458.                _loc3_ = _loc3_.m_next;
  459.             }
  460.          }
  461.          if(_loc1_ & _ee618.e_jointBit)
  462.          {
  463.             _loc5_ = m_jointList;
  464.             while(_loc5_)
  465.             {
  466.                _sv193(_loc5_);
  467.                _loc5_ = _loc5_.m_next;
  468.             }
  469.          }
  470.          if(_loc1_ & _ee618.e_pairBit)
  471.          {
  472.             _loc6_ = m_broadPhase;
  473.             _loc7_._br741(1 / _loc6_.m_quantizationFactor.x,1 / _loc6_.m_quantizationFactor.y);
  474.             _loc10_._br741(0.9,0.9,0.3);
  475.             _loc2_ = 0;
  476.             while(_loc2_ < _yl661.b2_tableCapacity)
  477.             {
  478.                _loc16_ = uint(_loc6_.m_pairManager.m_hashTable[_loc2_]);
  479.                while(_loc16_ != _yl661.b2_nullPair)
  480.                {
  481.                   _loc17_ = _loc6_.m_pairManager.m_pairs[_loc16_];
  482.                   _loc18_ = _loc6_.m_proxyPool[_loc17_.proxyId1];
  483.                   _loc19_ = _loc6_.m_proxyPool[_loc17_.proxyId2];
  484.                   _loc12_.lowerBound.x = _loc6_.m_worldAABB.lowerBound.x + _loc7_.x * _loc6_.m_bounds[0][_loc18_.lowerBounds[0]].value;
  485.                   _loc12_.lowerBound.y = _loc6_.m_worldAABB.lowerBound.y + _loc7_.y * _loc6_.m_bounds[1][_loc18_.lowerBounds[1]].value;
  486.                   _loc12_.upperBound.x = _loc6_.m_worldAABB.lowerBound.x + _loc7_.x * _loc6_.m_bounds[0][_loc18_.upperBounds[0]].value;
  487.                   _loc12_.upperBound.y = _loc6_.m_worldAABB.lowerBound.y + _loc7_.y * _loc6_.m_bounds[1][_loc18_.upperBounds[1]].value;
  488.                   _loc13_.lowerBound.x = _loc6_.m_worldAABB.lowerBound.x + _loc7_.x * _loc6_.m_bounds[0][_loc19_.lowerBounds[0]].value;
  489.                   _loc13_.lowerBound.y = _loc6_.m_worldAABB.lowerBound.y + _loc7_.y * _loc6_.m_bounds[1][_loc19_.lowerBounds[1]].value;
  490.                   _loc13_.upperBound.x = _loc6_.m_worldAABB.lowerBound.x + _loc7_.x * _loc6_.m_bounds[0][_loc19_.upperBounds[0]].value;
  491.                   _loc13_.upperBound.y = _loc6_.m_worldAABB.lowerBound.y + _loc7_.y * _loc6_.m_bounds[1][_loc19_.upperBounds[1]].value;
  492.                   _loc8_.x = 0.5 * (_loc12_.lowerBound.x + _loc12_.upperBound.x);
  493.                   _loc8_.y = 0.5 * (_loc12_.lowerBound.y + _loc12_.upperBound.y);
  494.                   _loc9_.x = 0.5 * (_loc13_.lowerBound.x + _loc13_.upperBound.x);
  495.                   _loc9_.y = 0.5 * (_loc13_.lowerBound.y + _loc13_.upperBound.y);
  496.                   m_debugDraw._lv253(_loc8_,_loc9_,_loc10_);
  497.                   _loc16_ = _loc17_.next;
  498.                }
  499.                _loc2_++;
  500.             }
  501.          }
  502.          if(_loc1_ & _ee618.e_aabbBit)
  503.          {
  504.             _loc6_ = m_broadPhase;
  505.             _loc20_ = _loc6_.m_worldAABB.lowerBound;
  506.             _loc21_ = _loc6_.m_worldAABB.upperBound;
  507.             _loc7_._br741(1 / _loc6_.m_quantizationFactor.x,1 / _loc6_.m_quantizationFactor.y);
  508.             _loc10_._br741(0.9,0.3,0.9);
  509.             _loc2_ = 0;
  510.             while(_loc2_ < _kc225.b2_maxProxies)
  511.             {
  512.                _loc22_ = _loc6_.m_proxyPool[_loc2_];
  513.                if(_loc22_._dt39() != false)
  514.                {
  515.                   _loc12_.lowerBound.x = _loc20_.x + _loc7_.x * _loc6_.m_bounds[0][_loc22_.lowerBounds[0]].value;
  516.                   _loc12_.lowerBound.y = _loc20_.y + _loc7_.y * _loc6_.m_bounds[1][_loc22_.lowerBounds[1]].value;
  517.                   _loc12_.upperBound.x = _loc20_.x + _loc7_.x * _loc6_.m_bounds[0][_loc22_.upperBounds[0]].value;
  518.                   _loc12_.upperBound.y = _loc20_.y + _loc7_.y * _loc6_.m_bounds[1][_loc22_.upperBounds[1]].value;
  519.                   _loc14_[0]._br741(_loc12_.lowerBound.x,_loc12_.lowerBound.y);
  520.                   _loc14_[1]._br741(_loc12_.upperBound.x,_loc12_.lowerBound.y);
  521.                   _loc14_[2]._br741(_loc12_.upperBound.x,_loc12_.upperBound.y);
  522.                   _loc14_[3]._br741(_loc12_.lowerBound.x,_loc12_.upperBound.y);
  523.                   m_debugDraw._kd272(_loc14_,4,_loc10_);
  524.                }
  525.                _loc2_++;
  526.             }
  527.             _loc14_[0]._br741(_loc20_.x,_loc20_.y);
  528.             _loc14_[1]._br741(_loc21_.x,_loc20_.y);
  529.             _loc14_[2]._br741(_loc21_.x,_loc21_.y);
  530.             _loc14_[3]._br741(_loc20_.x,_loc21_.y);
  531.             m_debugDraw._kd272(_loc14_,4,new _ny735(0.3,0.9,0.9));
  532.          }
  533.          if(_loc1_ & _ee618.e_obbBit)
  534.          {
  535.             _loc10_._br741(0.5,0.3,0.5);
  536.             _loc3_ = m_bodyList;
  537.             while(_loc3_)
  538.             {
  539.                _loc11_ = _loc3_.m_xf;
  540.                _loc4_ = _loc3_._tq424();
  541.                while(_loc4_)
  542.                {
  543.                   if(_loc4_.m_type == _hx306.e_polygonShape)
  544.                   {
  545.                      _loc23_ = _loc4_ as _bs125;
  546.                      _loc24_ = _loc23_._bm808();
  547.                      _loc25_ = _loc24_.extents;
  548.                      _loc14_[0]._br741(-_loc25_.x,-_loc25_.y);
  549.                      _loc14_[1]._br741(_loc25_.x,-_loc25_.y);
  550.                      _loc14_[2]._br741(_loc25_.x,_loc25_.y);
  551.                      _loc14_[3]._br741(-_loc25_.x,_loc25_.y);
  552.                      _loc2_ = 0;
  553.                      while(_loc2_ < 4)
  554.                      {
  555.                         _loc26_ = _loc24_.R;
  556.                         _loc27_ = _loc14_[_loc2_];
  557.                         _loc28_ = _loc24_.center.x + (_loc26_.col1.x * _loc27_.x + _loc26_.col2.x * _loc27_.y);
  558.                         _loc14_[_loc2_].y = _loc24_.center.y + (_loc26_.col1.y * _loc27_.x + _loc26_.col2.y * _loc27_.y);
  559.                         _loc14_[_loc2_].x = _loc28_;
  560.                         _loc26_ = _loc11_.R;
  561.                         _loc28_ = _loc11_.position.x + (_loc26_.col1.x * _loc27_.x + _loc26_.col2.x * _loc27_.y);
  562.                         _loc14_[_loc2_].y = _loc11_.position.y + (_loc26_.col1.y * _loc27_.x + _loc26_.col2.y * _loc27_.y);
  563.                         _loc14_[_loc2_].x = _loc28_;
  564.                         _loc2_++;
  565.                      }
  566.                      m_debugDraw._kd272(_loc14_,4,_loc10_);
  567.                   }
  568.                   _loc4_ = _loc4_.m_next;
  569.                }
  570.                _loc3_ = _loc3_.m_next;
  571.             }
  572.          }
  573.          if(_loc1_ & _ee618.e_centerOfMassBit)
  574.          {
  575.             _loc3_ = m_bodyList;
  576.             while(_loc3_)
  577.             {
  578.                _loc11_ = s_xf;
  579.                _loc11_.R = _loc3_.m_xf.R;
  580.                _loc11_.position = _loc3_._yd753();
  581.                m_debugDraw._ex362(_loc11_);
  582.                _loc3_ = _loc3_.m_next;
  583.             }
  584.          }
  585.       }
  586.       
  587.       public function _sv193(param1:_yw701) : void
  588.       {
  589.          var _loc2_:_th791 = null;
  590.          var _loc3_:_th791 = null;
  591.          var _loc4_:_ni781 = null;
  592.          var _loc5_:_ni781 = null;
  593.          var _loc6_:b2Vec2 = null;
  594.          var _loc7_:b2Vec2 = null;
  595.          var _loc8_:b2Vec2 = null;
  596.          var _loc9_:b2Vec2 = null;
  597.          var _loc10_:_ny735 = null;
  598.          var _loc11_:_av415 = null;
  599.          var _loc12_:b2Vec2 = null;
  600.          var _loc13_:b2Vec2 = null;
  601.          _loc2_ = param1.m_body1;
  602.          _loc3_ = param1.m_body2;
  603.          _loc4_ = _loc2_.m_xf;
  604.          _loc5_ = _loc3_.m_xf;
  605.          _loc6_ = _loc4_.position;
  606.          _loc7_ = _loc5_.position;
  607.          _loc8_ = param1._ms688();
  608.          _loc9_ = param1._va771();
  609.          _loc10_ = s_jointColor;
  610.          switch(param1.m_type)
  611.          {
  612.             case _yw701.e_distanceJoint:
  613.                m_debugDraw._lv253(_loc8_,_loc9_,_loc10_);
  614.                break;
  615.             case _yw701.e_pulleyJoint:
  616.                _loc11_ = param1 as _av415;
  617.                _loc12_ = _loc11_._yy353();
  618.                _loc13_ = _loc11_._qt125();
  619.                m_debugDraw._lv253(_loc12_,_loc8_,_loc10_);
  620.                m_debugDraw._lv253(_loc13_,_loc9_,_loc10_);
  621.                m_debugDraw._lv253(_loc12_,_loc13_,_loc10_);
  622.                break;
  623.             case _yw701.e_mouseJoint:
  624.                m_debugDraw._lv253(_loc8_,_loc9_,_loc10_);
  625.                break;
  626.             default:
  627.                if(_loc2_ != m_groundBody)
  628.                {
  629.                   m_debugDraw._lv253(_loc6_,_loc8_,_loc10_);
  630.                }
  631.                m_debugDraw._lv253(_loc8_,_loc9_,_loc10_);
  632.                if(_loc3_ != m_groundBody)
  633.                {
  634.                   m_debugDraw._lv253(_loc7_,_loc9_,_loc10_);
  635.                }
  636.          }
  637.       }
  638.       
  639.       public function _sf430(param1:Boolean) : void
  640.       {
  641.          m_positionCorrection = param1;
  642.       }
  643.       
  644.       public function _ex420() : _th791
  645.       {
  646.          return m_groundBody;
  647.       }
  648.       
  649.       public function _sa385(param1:_hx306, param2:_ni781, param3:_ny735, param4:Boolean) : void
  650.       {
  651.          var _loc5_:_ny735 = null;
  652.          var _loc6_:_vy532 = null;
  653.          var _loc7_:b2Vec2 = null;
  654.          var _loc8_:Number = NaN;
  655.          var _loc9_:b2Vec2 = null;
  656.          var _loc10_:int = 0;
  657.          var _loc11_:_bs125 = null;
  658.          var _loc12_:int = 0;
  659.          var _loc13_:Array = null;
  660.          var _loc14_:Array = null;
  661.          var _loc15_:Array = null;
  662.          _loc5_ = s_coreColor;
  663.          switch(param1.m_type)
  664.          {
  665.             case _hx306.e_circleShape:
  666.                _loc6_ = param1 as _vy532;
  667.                _loc7_ = _ui293._db724(param2,_loc6_.m_localPosition);
  668.                _loc8_ = _loc6_.m_radius;
  669.                _loc9_ = param2.R.col1;
  670.                m_debugDraw._ec502(_loc7_,_loc8_,_loc9_,param3);
  671.                if(param4)
  672.                {
  673.                   m_debugDraw._na573(_loc7_,_loc8_ - _kc225.b2_toiSlop,_loc5_);
  674.                }
  675.                break;
  676.             case _hx306.e_polygonShape:
  677.                _loc11_ = param1 as _bs125;
  678.                _loc12_ = _loc11_._px512();
  679.                _loc13_ = _loc11_._fh374();
  680.                _loc14_ = new Array(_kc225.b2_maxPolygonVertices);
  681.                _loc10_ = 0;
  682.                while(_loc10_ < _loc12_)
  683.                {
  684.                   _loc14_[_loc10_] = _ui293._db724(param2,_loc13_[_loc10_]);
  685.                   _loc10_++;
  686.                }
  687.                m_debugDraw._cy655(_loc14_,_loc12_,param3);
  688.                if(param4)
  689.                {
  690.                   _loc15_ = _loc11_._sv339();
  691.                   _loc10_ = 0;
  692.                   while(_loc10_ < _loc12_)
  693.                   {
  694.                      _loc14_[_loc10_] = _ui293._db724(param2,_loc15_[_loc10_]);
  695.                      _loc10_++;
  696.                   }
  697.                   m_debugDraw._kd272(_loc14_,_loc12_,_loc5_);
  698.                }
  699.          }
  700.       }
  701.       
  702.       public function _df47() : int
  703.       {
  704.          return m_jointCount;
  705.       }
  706.       
  707.       public function _mv283() : int
  708.       {
  709.          return m_contactCount;
  710.       }
  711.       
  712.       public function _tg527(param1:_wy488) : void
  713.       {
  714.          m_boundaryListener = param1;
  715.       }
  716.       
  717.       public function _ss251(param1:_ut97) : void
  718.       {
  719.          var _loc2_:_th791 = null;
  720.          var _loc3_:_hx306 = null;
  721.          var _loc4_:_hx306 = null;
  722.          var _loc5_:_th791 = null;
  723.          var _loc6_:_th791 = null;
  724.          var _loc7_:_eg754 = null;
  725.          var _loc8_:_tn475 = null;
  726.          var _loc9_:int = 0;
  727.          var _loc10_:Array = null;
  728.          var _loc11_:_nb823 = null;
  729.          var _loc12_:_nb823 = null;
  730.          var _loc13_:Number = NaN;
  731.          var _loc14_:_th791 = null;
  732.          var _loc15_:int = 0;
  733.          var _loc16_:_ut97 = null;
  734.          var _loc17_:int = 0;
  735.          var _loc18_:Number = NaN;
  736.          var _loc19_:Number = NaN;
  737.          var _loc20_:_th791 = null;
  738.          var _loc21_:Boolean = false;
  739.          _loc8_ = new _tn475(m_bodyCount,_kc225.b2_maxTOIContactsPerIsland,0,m_stackAllocator,m_contactListener);
  740.          _loc9_ = m_bodyCount;
  741.          _loc10_ = new Array(_loc9_);
  742.          _loc2_ = m_bodyList;
  743.          while(_loc2_)
  744.          {
  745.             _loc2_.m_flags &= ~_th791.e_islandFlag;
  746.             _loc2_.m_sweep.t0 = 0;
  747.             _loc2_ = _loc2_.m_next;
  748.          }
  749.          _loc11_ = m_contactList;
  750.          while(_loc11_)
  751.          {
  752.             _loc11_.m_flags &= ~(_nb823.e_toiFlag | _nb823.e_islandFlag);
  753.             _loc11_ = _loc11_.m_next;
  754.          }
  755.          while(true)
  756.          {
  757.             _loc12_ = null;
  758.             _loc13_ = 1;
  759.             _loc11_ = m_contactList;
  760.             for(; _loc11_; _loc11_ = _loc11_.m_next)
  761.             {
  762.                if(!(_loc11_.m_flags & (_nb823.e_slowFlag | _nb823.e_nonSolidFlag)))
  763.                {
  764.                   _loc18_ = 1;
  765.                   if(_loc11_.m_flags & _nb823.e_toiFlag)
  766.                   {
  767.                      _loc18_ = _loc11_.m_toi;
  768.                   }
  769.                   else
  770.                   {
  771.                      _loc3_ = _loc11_.m_shape1;
  772.                      _loc4_ = _loc11_.m_shape2;
  773.                      _loc5_ = _loc3_.m_body;
  774.                      _loc6_ = _loc4_.m_body;
  775.                      if((_loc5_._ur192() || _loc5_._bk718()) && (_loc6_._ur192() || _loc6_._bk718()))
  776.                      {
  777.                         continue;
  778.                      }
  779.                      _loc19_ = _loc5_.m_sweep.t0;
  780.                      if(_loc5_.m_sweep.t0 < _loc6_.m_sweep.t0)
  781.                      {
  782.                         _loc19_ = _loc6_.m_sweep.t0;
  783.                         _loc5_.m_sweep._dd348(_loc19_);
  784.                      }
  785.                      else if(_loc6_.m_sweep.t0 < _loc5_.m_sweep.t0)
  786.                      {
  787.                         _loc19_ = _loc5_.m_sweep.t0;
  788.                         _loc6_.m_sweep._dd348(_loc19_);
  789.                      }
  790.                      _loc18_ = _he523._vt746(_loc11_.m_shape1,_loc5_.m_sweep,_loc11_.m_shape2,_loc6_.m_sweep);
  791.                      if(_loc18_ > 0 && _loc18_ < 1)
  792.                      {
  793.                         _loc18_ = (1 - _loc18_) * _loc19_ + _loc18_;
  794.                         if(_loc18_ > 1)
  795.                         {
  796.                            _loc18_ = 1;
  797.                         }
  798.                      }
  799.                      _loc11_.m_toi = _loc18_;
  800.                      _loc11_.m_flags |= _nb823.e_toiFlag;
  801.                   }
  802.                   if(Number.MIN_VALUE < _loc18_ && _loc18_ < _loc13_)
  803.                   {
  804.                      _loc12_ = _loc11_;
  805.                      _loc13_ = _loc18_;
  806.                   }
  807.                }
  808.             }
  809.             if(_loc12_ == null || 1 - 100 * Number.MIN_VALUE < _loc13_)
  810.             {
  811.                break;
  812.             }
  813.             _loc3_ = _loc12_.m_shape1;
  814.             _loc4_ = _loc12_.m_shape2;
  815.             _loc5_ = _loc3_.m_body;
  816.             _loc6_ = _loc4_.m_body;
  817.             _loc5_._dd348(_loc13_);
  818.             _loc6_._dd348(_loc13_);
  819.             _loc12_._ne371(m_contactListener);
  820.             _loc12_.m_flags &= ~_nb823.e_toiFlag;
  821.             if(_loc12_.m_manifoldCount != 0)
  822.             {
  823.                _loc14_ = _loc5_;
  824.                if(_loc14_._ur192())
  825.                {
  826.                   _loc14_ = _loc6_;
  827.                }
  828.                _loc8_._re527();
  829.                _loc15_ = 0;
  830.                var _loc22_:*;
  831.                _loc10_[_loc22_ = _loc15_++] = _loc14_;
  832.                _loc14_.m_flags |= _th791.e_islandFlag;
  833.                while(_loc15_ > 0)
  834.                {
  835.                   _loc2_ = _loc10_[--_loc15_];
  836.                   _loc8_._pa292(_loc2_);
  837.                   _loc2_.m_flags &= ~_th791.e_sleepFlag;
  838.                   if(!_loc2_._ur192())
  839.                   {
  840.                      _loc7_ = _loc2_.m_contactList;
  841.                      while(_loc7_)
  842.                      {
  843.                         if(_loc8_.m_contactCount != _loc8_.m_contactCapacity)
  844.                         {
  845.                            if(!(_loc7_.contact.m_flags & (_nb823.e_islandFlag | _nb823.e_slowFlag | _nb823.e_nonSolidFlag)))
  846.                            {
  847.                               if(_loc7_.contact.m_manifoldCount != 0)
  848.                               {
  849.                                  _loc8_._hu475(_loc7_.contact);
  850.                                  _loc7_.contact.m_flags |= _nb823.e_islandFlag;
  851.                                  _loc20_ = _loc7_.other;
  852.                                  if(!(_loc20_.m_flags & _th791.e_islandFlag))
  853.                                  {
  854.                                     if(_loc20_._ur192() == false)
  855.                                     {
  856.                                        _loc20_._dd348(_loc13_);
  857.                                        _loc20_._uo631();
  858.                                     }
  859.                                     var _loc23_:*;
  860.                                     _loc10_[_loc23_ = _loc15_++] = _loc20_;
  861.                                     _loc20_.m_flags |= _th791.e_islandFlag;
  862.                                  }
  863.                               }
  864.                            }
  865.                         }
  866.                         _loc7_ = _loc7_.next;
  867.                      }
  868.                   }
  869.                }
  870.                _loc16_ = new _ut97();
  871.                _loc16_.dt = (1 - _loc13_) * param1.dt;
  872.                _loc16_.inv_dt = 1 / _loc16_.dt;
  873.                _loc16_.maxIterations = param1.maxIterations;
  874.                _loc8_._ss251(_loc16_);
  875.                _loc17_ = 0;
  876.                while(_loc17_ < _loc8_.m_bodyCount)
  877.                {
  878.                   _loc2_ = _loc8_.m_bodies[_loc17_];
  879.                   _loc2_.m_flags &= ~_th791.e_islandFlag;
  880.                   if(!(_loc2_.m_flags & (_th791.e_sleepFlag | _th791.e_frozenFlag)))
  881.                   {
  882.                      if(!_loc2_._ur192())
  883.                      {
  884.                         _loc21_ = _loc2_._nt224();
  885.                         if(_loc21_ == false && m_boundaryListener != null)
  886.                         {
  887.                            m_boundaryListener._al490(_loc2_);
  888.                         }
  889.                         _loc7_ = _loc2_.m_contactList;
  890.                         while(_loc7_)
  891.                         {
  892.                            _loc7_.contact.m_flags &= ~_nb823.e_toiFlag;
  893.                            _loc7_ = _loc7_.next;
  894.                         }
  895.                      }
  896.                   }
  897.                   _loc17_++;
  898.                }
  899.                _loc17_ = 0;
  900.                while(_loc17_ < _loc8_.m_contactCount)
  901.                {
  902.                   _loc11_ = _loc8_.m_contacts[_loc17_];
  903.                   _loc11_.m_flags &= ~(_nb823.e_toiFlag | _nb823.e_islandFlag);
  904.                   _loc17_++;
  905.                }
  906.                m_broadPhase._ol779();
  907.             }
  908.          }
  909.       }
  910.       
  911.       public function _eq278(param1:_ut97) : void
  912.       {
  913.          var _loc2_:_th791 = null;
  914.          var _loc3_:_tn475 = null;
  915.          var _loc4_:_nb823 = null;
  916.          var _loc5_:_yw701 = null;
  917.          var _loc6_:int = 0;
  918.          var _loc7_:Array = null;
  919.          var _loc8_:_th791 = null;
  920.          var _loc9_:int = 0;
  921.          var _loc10_:int = 0;
  922.          var _loc11_:_th791 = null;
  923.          var _loc12_:_eg754 = null;
  924.          var _loc13_:_gs664 = null;
  925.          var _loc14_:Boolean = false;
  926.          m_positionIterationCount = 0;
  927.          _loc3_ = new _tn475(m_bodyCount,m_contactCount,m_jointCount,m_stackAllocator,m_contactListener);
  928.          _loc2_ = m_bodyList;
  929.          while(_loc2_)
  930.          {
  931.             _loc2_.m_flags &= ~_th791.e_islandFlag;
  932.             _loc2_ = _loc2_.m_next;
  933.          }
  934.          _loc4_ = m_contactList;
  935.          while(_loc4_)
  936.          {
  937.             _loc4_.m_flags &= ~_nb823.e_islandFlag;
  938.             _loc4_ = _loc4_.m_next;
  939.          }
  940.          _loc5_ = m_jointList;
  941.          while(_loc5_)
  942.          {
  943.             _loc5_.m_islandFlag = false;
  944.             _loc5_ = _loc5_.m_next;
  945.          }
  946.          _loc6_ = m_bodyCount;
  947.          _loc7_ = new Array(_loc6_);
  948.          _loc8_ = m_bodyList;
  949.          while(_loc8_)
  950.          {
  951.             if(!(_loc8_.m_flags & (_th791.e_islandFlag | _th791.e_sleepFlag | _th791.e_frozenFlag)))
  952.             {
  953.                if(!_loc8_._ur192())
  954.                {
  955.                   _loc3_._re527();
  956.                   _loc9_ = 0;
  957.                   var _loc15_:*;
  958.                   _loc7_[_loc15_ = _loc9_++] = _loc8_;
  959.                   _loc8_.m_flags |= _th791.e_islandFlag;
  960.                   while(_loc9_ > 0)
  961.                   {
  962.                      _loc2_ = _loc7_[--_loc9_];
  963.                      _loc3_._pa292(_loc2_);
  964.                      _loc2_.m_flags &= ~_th791.e_sleepFlag;
  965.                      if(!_loc2_._ur192())
  966.                      {
  967.                         _loc12_ = _loc2_.m_contactList;
  968.                         while(_loc12_)
  969.                         {
  970.                            if(!(_loc12_.contact.m_flags & (_nb823.e_islandFlag | _nb823.e_nonSolidFlag)))
  971.                            {
  972.                               if(_loc12_.contact.m_manifoldCount != 0)
  973.                               {
  974.                                  _loc3_._hu475(_loc12_.contact);
  975.                                  _loc12_.contact.m_flags |= _nb823.e_islandFlag;
  976.                                  _loc11_ = _loc12_.other;
  977.                                  if(!(_loc11_.m_flags & _th791.e_islandFlag))
  978.                                  {
  979.                                     var _loc16_:*;
  980.                                     _loc7_[_loc16_ = _loc9_++] = _loc11_;
  981.                                     _loc11_.m_flags |= _th791.e_islandFlag;
  982.                                  }
  983.                               }
  984.                            }
  985.                            _loc12_ = _loc12_.next;
  986.                         }
  987.                         _loc13_ = _loc2_.m_jointList;
  988.                         while(_loc13_)
  989.                         {
  990.                            if(_loc13_.joint.m_islandFlag != true)
  991.                            {
  992.                               _loc3_._ti526(_loc13_.joint);
  993.                               _loc13_.joint.m_islandFlag = true;
  994.                               _loc11_ = _loc13_.other;
  995.                               if(!(_loc11_.m_flags & _th791.e_islandFlag))
  996.                               {
  997.                                  _loc7_[_loc16_ = _loc9_++] = _loc11_;
  998.                                  _loc11_.m_flags |= _th791.e_islandFlag;
  999.                               }
  1000.                            }
  1001.                            _loc13_ = _loc13_.next;
  1002.                         }
  1003.                      }
  1004.                   }
  1005.                   _loc3_._eq278(param1,m_gravity,m_positionCorrection,m_allowSleep);
  1006.                   if(_loc3_.m_positionIterationCount > m_positionIterationCount)
  1007.                   {
  1008.                      m_positionIterationCount = _loc3_.m_positionIterationCount;
  1009.                   }
  1010.                   _loc10_ = 0;
  1011.                   while(_loc10_ < _loc3_.m_bodyCount)
  1012.                   {
  1013.                      _loc2_ = _loc3_.m_bodies[_loc10_];
  1014.                      if(_loc2_._ur192())
  1015.                      {
  1016.                         _loc2_.m_flags &= ~_th791.e_islandFlag;
  1017.                      }
  1018.                      _loc10_++;
  1019.                   }
  1020.                }
  1021.             }
  1022.             _loc8_ = _loc8_.m_next;
  1023.          }
  1024.          _loc2_ = m_bodyList;
  1025.          while(_loc2_)
  1026.          {
  1027.             if(!(_loc2_.m_flags & (_th791.e_sleepFlag | _th791.e_frozenFlag)))
  1028.             {
  1029.                if(!_loc2_._ur192())
  1030.                {
  1031.                   _loc14_ = _loc2_._nt224();
  1032.                   if(_loc14_ == false && m_boundaryListener != null)
  1033.                   {
  1034.                      m_boundaryListener._al490(_loc2_);
  1035.                   }
  1036.                }
  1037.             }
  1038.             _loc2_ = _loc2_.m_next;
  1039.          }
  1040.          m_broadPhase._ol779();
  1041.       }
  1042.    }
  1043. }
  1044.  
  1045.